/*    */ package com.qmsk.business.task.myAdvisor.controller;
/*    */ 
/*    */ import com.qmsk.business.manage.cust.dao.CustDAO;
/*    */ import com.qmsk.business.member.shopMember.dao.ShopMemberDAO;
/*    */ import com.qmsk.business.task.myAdvisor.dao.MyAdvisorDao;
/*    */ import com.utils.basic.MapUtils;
/*    */ import com.utils.gson.out.GsonEbRst;
/*    */ import com.utils.jdbc.connection.DbConnection;
/*    */ import com.utils.web.RequestUtils;
/*    */ import com.utils.web.ResponseUtils;
/*    */ import java.sql.SQLException;
/*    */ import java.util.HashMap;
/*    */ import java.util.Map;
/*    */ import javax.servlet.http.HttpServletRequest;
/*    */ import javax.servlet.http.HttpServletResponse;
/*    */ import org.apache.log4j.Logger;
/*    */ import org.springframework.beans.factory.annotation.Autowired;
/*    */ import org.springframework.stereotype.Controller;
/*    */ import org.springframework.transaction.annotation.Transactional;
/*    */ import org.springframework.web.bind.annotation.RequestMapping;
/*    */ 
/*    */ @Controller
/*    */ @RequestMapping({"myAdvisor"})
/*    */ public class MyAdvisorController
/*    */ {
/* 44 */   private static final Logger logger = Logger.getLogger(MyAdvisorController.class);
/*    */ 
/*    */   @Autowired
/*    */   private MyAdvisorDao dao;
/*    */ 
/*    */   @Autowired
/*    */   private ShopMemberDAO shopMemberDAO;
/*    */ 
/*    */   @Autowired
/*    */   private CustDAO custDAO;
/*    */ 
/*    */   @Transactional(rollbackFor={Exception.class})
/*    */   @RequestMapping(value={"del/shopId/{shopId}"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
/*    */   public void delete(HttpServletRequest request, HttpServletResponse response)
/*    */   {
/* 68 */     String id = RequestUtils.getStringOfId(request);
/*    */     try {
/* 70 */       String[] strParams = id.split(",");
/* 71 */       int nResult = this.dao.deleteParams(strParams);
/* 72 */       if (nResult > 0) {
/* 73 */         DbConnection.commit();
/*    */       }
/*    */       else {
/* 76 */         DbConnection.rollback();
/*    */       }
/* 78 */       ResponseUtils.setSqlResultResponse(nResult, 
/* 79 */         RequestUtils.getSqlDeleteDataErrorMessage(request), 
/* 80 */         response);
/*    */     } catch (Exception e) {
/* 82 */       DbConnection.rollback();
/* 83 */       logger.error(e);
/* 84 */       ResponseUtils.setErrorMsgResponse(
/* 85 */         RequestUtils.getSqlDeleteDataErrorMessage(request) + ":" + 
/* 86 */         e.getMessage(), response);
/*    */     }
/*    */   }
/*    */ 
/*    */   @RequestMapping(value={"find/myAdvisor"}, method={org.springframework.web.bind.annotation.RequestMethod.GET})
/*    */   public void getListShopIdOpt(HttpServletRequest request, HttpServletResponse response)
/*    */   {
/*    */     try
/*    */     {
/* 97 */       Map params = new HashMap();
/* 98 */       MapUtils.addToMap(params, "id", RequestUtils.getStringOfId(request));
/* 99 */       Long shopId = RequestUtils.getLong(request, "shopId");
/* 100 */       String memberId = RequestUtils.getString(request, "memberId");
/* 101 */       String opneId = RequestUtils.getString(request, "opneId");
/*    */ 
/* 107 */       MapUtils.addToMap(params, "shopId", shopId);
/* 108 */       MapUtils.addToMap(params, "memberId", memberId);
/* 109 */       MapUtils.addToMap(params, "openId", opneId);
/*    */ 
/* 114 */       GsonEbRst gsonEbRst = this.dao.getGsonOfShopIdAll(params);
/* 115 */       ResponseUtils.setResponseResult(gsonEbRst, response);
/*    */     } catch (SQLException e) {
/* 117 */       logger.error(e);
/* 118 */       ResponseUtils.setErrorMsgResponse(
/* 119 */         RequestUtils.getFindDataErrorMessage(request), response);
/*    */     }
/*    */   }
/*    */ }

/* Location:           C:\Users\Administrator\Desktop\新建文件夹\WEB-INF\classes\
 * Qualified Name:     com.qmsk.business.task.myAdvisor.controller.MyAdvisorController
 * JD-Core Version:    0.5.3
 */